#ifndef EvilEye_H
#define EvilEye_H

#include <QtGui>
#include "ee_screenshot.h"

namespace Ui {
	class EvilEye;
}

class EvilEye : public QMainWindow {
    Q_OBJECT
public:
	EvilEye(QWidget * _parent = 0);
	~EvilEye();

private:
	Ui::EvilEye *ui;
	enum {FullPicture = 0, DiffPicture = 1};
	quint64 id, prev_id;
	int frames_count;
	int slow_timer;
	QTime prev_time;
	QImage view_image, current_image, prev_image;
	QString cur_address_request, cur_address_data;
	QLabel * view;
	EE_Screenshot screen_shot;
	void reconnectRequest();
	void reconnectData();
	void timerEvent(QTimerEvent * _te);
	bool eventFilter(QObject * _obj, QEvent * _ev);
	QVariantMap serializeMouseEvent(QMouseEvent * _me);
	QVariantMap serializeKeyboardEvent(QKeyEvent * _ke);
private slots:
	void on_request_picture(int _pic_mode);
	void on_picture_data(int _pic_mode, int _id, QByteArray _data, int _w, int _h);
	void on_actionExit_triggered();
	void on_watch_clicked();
	void on_remote_event(QVariantMap _map);
signals:
	void request_picture(int _pic_mode);
	void picture_data(int _pic_mode, int _id, QByteArray _data, int _w, int _h);
	void draw_pixmap(QPixmap _pixmap);
	void remote_event(QVariantMap);
};

#endif // EvilEye_H
